package com.yunpuvip.sachet.modular.util.sms;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;

public class SendSmsUtil {
    public static final Logger logger = LoggerFactory.getLogger(SendSmsUtil.class);

    public static String sendSmsCode(String phone, Integer sendType) throws Exception {
        String code = Sendsms.getSmsCode();
        String content = "您的验证码是：" + code + "。请不要把验证码泄露给其他人。";
//        Sendsms.send(phone, content);
        AliyunSms.send(phone, code, sendType);
        System.out.println("时间:" + LocalDateTime.now() + ";获得的验证码:" + code);
        return code;
    }

    /**
     * 充值短信
     * @param phone 收件人电话
     * @param sendType 短信类型
     *
     * @param data 内容主体
     * @param
     * @return
     * @throws Exception
     */

    public static String sendSmsRechargeMsg(String phone, String data,Integer sendType) throws Exception {
        AliyunSms.sendSmsMsg(phone, data ,sendType);
        System.out.println("时间:" + LocalDateTime.now() + "" + data);
        return data;
    }

}
